<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@ include file="/common/taglibs.jsp"%>
<%@ page import="com.msmall.base.util.ConstantDB" language="java"%>
<c:set var="AVALIABLE" value="<%=ConstantDB.AVALIABLE%>"></c:set>
<c:set var="UNAVALIABLE" value="<%=ConstantDB.UNAVALIABLE%>"></c:set>

<c:set var="questionSegments" value="${questionSegments.children}"></c:set>
<div id="topTabs" class="quescenttab martop10">
	<p id="p-hotTabs">热点问题</p>
	<p id="p-commendTabs">推荐问题</p>
</div>
<script>
$.each($("#topTabs p"),function(i, n){
	n.onmouseover=function(){
		this.timer=window.setTimeout(function(){
			$("#topTabs p").removeClass("qcentquesnavbg").addClass("");
			$("#hotTabs").css("display","none");
			$("#commendTabs").css("display","none");
			n.className="qcentquesnavbg";
			
			var id = $(n).attr("id");
			var temps = id.split("-");
			var suffix = temps[1];
			$("#"+suffix).css("display","block");
		},100)
	};
	n.onmouseout=function(){window.clearTimeout(this.timer);}
});
$("#topTabs p:first").mouseover(); 
</script>
<div id="hotTabs" class="qcentquescont">
	<div id="hotTabsHeader" class="qcentquesnav">
		<c:forEach var="cascadeC" items="${questionSegments}" varStatus="segmentStatus">
	   		<c:set var="segment" value="${cascadeC.current}"></c:set>
	   		<p id="hotTabs-${segment.segmentid}">
	   			<a href="<c:url value='/question/list.do?segid=${segment.segmentid}'/>">
	   				<c:out value='${segment.title}'/>
	   			</a>
	   		</p>
	   	</c:forEach>
	</div>
	<c:forEach var="hotMap" items="${questionIndexHotMap}" varStatus="hotStatus">
		<c:set var="segid" value="${hotMap.key}"></c:set>
		<c:set var="questions" value="${hotMap.value}"></c:set>
		<ul id="hotTabs-content-${segid}" class="qcentquesul" style="display:none">
			<c:forEach var="question" items="${questions}" varStatus="status">
				<c:choose>
					<c:when test="${question.enabled == AVALIABLE}">
					<li>
						<span class="fl">
							<a class="lH33" href="<c:url value='/question/view.do?questionid=${question.questionid}'/>">
								<c:out value="${question.content20}"/>
							</a>
						</span>
						<span class="fr s666">
							<fmt:formatDate value="${question.createTime}" pattern="yyyy-MM-dd"/>
						</span>
					</li>
					</c:when>
					<c:otherwise>
					</c:otherwise>
				</c:choose>
			</c:forEach>
		</ul>
   	</c:forEach>
</div>
<script>
$.each($("#hotTabsHeader p"),function(i, n){
	n.onmouseover=function(){
		this.timer=window.setTimeout(function(){
			$("#hotTabsHeader p").removeClass("qcentquesnavbg").addClass("");
			$("#hotTabs .qcentquesul").css("display","none");
			n.className="qcentquesnavbg";
			
			var id = $(n).attr("id");
			var temps = id.split("-");
			var suffix = temps[1];
			$("#hotTabs-content-"+suffix).css("display","block");
	//	$("#hotTabsHeader li").removeClass("tabs4HeaderCurrent").addClass("tabs4Header");
	//	$("#hotTabs .tabs4Content").css("display","none").eq(i).css("display","block");
	//	n.className="tabs4HeaderCurrent";
		},100)
	};
	n.onmouseout=function(){window.clearTimeout(this.timer);}
});
$("#hotTabsHeader p:first").mouseover(); 
</script>
<div id="commendTabs" class="qcentquescont" style="display:none">
	<div id="commendTabsHeader" class="qcentquesnav">
		<c:forEach var="cascadeC" items="${questionSegments}" varStatus="segmentStatus">
	   		<c:set var="segment" value="${cascadeC.current}"></c:set>
	   		<p id="commendTabs-${segment.segmentid}">
	   			<a href="<c:url value='/question/list.do?segid=${segment.segmentid}'/>">
	   				<c:out value='${segment.title}'/>
	   			</a>
	   		</p>
	   	</c:forEach>
	</div>
	<c:forEach var="commedMap" items="${questionIndexCommendMap}" varStatus="hotStatus">
		<c:set var="segid" value="${commedMap.key}"></c:set>
		<c:set var="questions" value="${commedMap.value}"></c:set>
		<ul id="commendTabs-content-${segid}" class="qcentquesul" style="display:none">
			<c:forEach var="commend" items="${questions}" varStatus="status">
				<c:set var="question" value="${commend.obj}"></c:set>
				<c:choose>
					<c:when test="${question.enabled == AVALIABLE}">
					<li>
						<span class="fl">
							<a class="lH33" href="<c:url value='/question/view.do?questionid=${question.questionid}'/>">
								<c:out value="${question.content20}"/>
							</a>
						</span>
						<span class="fr s666">
							<fmt:formatDate value="${question.createTime}" pattern="yyyy-MM-dd"/>
						</span>
					</li>
					</c:when>
					<c:otherwise>
					</c:otherwise>
				</c:choose>
			</c:forEach>
		</ul>
   	</c:forEach>
</div>
<script>
$.each($("#commendTabsHeader p"),function(i, n){
	n.onmouseover=function(){
		this.timer=window.setTimeout(function(){
		$("#commendTabsHeader p").removeClass("qcentquesnavbg").addClass("");
		$("#commendTabs .qcentquesul").css("display","none");
		n.className="qcentquesnavbg";

		var id = $(n).attr("id");
		var temps = id.split("-");
		var suffix = temps[1];
		$("#commendTabs-content-"+suffix).css("display","block");
		//$("#commendTabsHeader li").removeClass("tabs4HeaderCurrent").addClass("tabs4Header");
		//$("#commendTabs .tabs4Content").css("display","none").eq(i).css("display","block");
		//n.className="tabs4HeaderCurrent";
		},100)
	};
	n.onmouseout=function(){window.clearTimeout(this.timer);}
});
$("#commendTabsHeader p:first").mouseover(); 
</script>